﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CarFrameWork.Model;

namespace CarFrameWork.UI.ProductDesign._3DModelingDesign.ZhuJianSuQi
{
    public partial class 隔套 : PartFormBase
    {
        CarFrameWork.Model.CanShuHua.隔套 zcgt = new CarFrameWork.Model.CanShuHua.隔套();//kao
        public 隔套()
        {
            InitializeComponent();
        }

      private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            if (TestContent())
            {
                FormToModel();
                zcgt.Add();
            }
            else
            {
                MessageBox.Show("参数不能为空！","提示");
            }
        }

        private void FormToModel()
        {
            zcgt.ID = 2402202;
            zcgt.name = "主齿隔套";
            //zcgt.C1 = Convert.ToSingle(textBox1.Text);
            //zcgt.C2 = Convert.ToSingle(textBox2.Text);
            zcgt.T = Convert.ToSingle(textBox3.Text);
            zcgt.D2 = Convert.ToSingle(textBox4.Text);
            //zcgt.L = Convert.ToSingle(textBox5.Text);
            //zcgt.L1 = Convert.ToSingle(textBox6.Text);
            zcgt.R = Convert.ToSingle(textBox7.Text);
         }


        private bool TestContent()
        {
            if (!InspectionText(this.textBox1))
                return false;
            if (!InspectionText(this.textBox2))
                return false;
            if (!InspectionText(this.textBox3))
                return false;
            if (!InspectionText(this.textBox4))
                return false;
            if (!InspectionText(this.textBox5))
                return false;
            if (!InspectionText(this.textBox6))
                return false;
            if (!InspectionText(this.textBox7))
                return false;
                        return true;
        }
        
    }
}